package com.jwb.task;

import lombok.extern.slf4j.Slf4j;
import org.checkerframework.checker.units.qual.A;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
@Slf4j
@Async
public class TestTask {

    @Scheduled(cron = "0 0/1 * * * ?")
    public void scheduled(){
        log.info("["+Thread.currentThread().getName()+"] =====>>>>>使用cron  {}",System.currentTimeMillis());
    }
    
    
//    @Scheduled(fixedDelay = 5000)
//    public void scheduled2() {
//        log.info("["+Thread.currentThread().getName()+"] =====>>>>>fixedDelay{}",System.currentTimeMillis());
//    }
//
//    @Scheduled(initialDelay = 10000,fixedRate = 5000)
//    public void scheduled1() {
//        log.info("=====>>>>>使用fixedRate{}", System.currentTimeMillis());
//    }

}
